ci/security/test: automated audit fixes for FirstradePlatform - #183
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0eedf6796f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) | ||
| _AUTH_HEADER_RE = re.compile(r"(?i)\b(Bearer|Basic)\s+([A-Za-z0-9._~+/=-]{8,})") | ||
| _ASSIGNMENT_RE = re.compile( | ||
| r"(?i)\b(api[_-]?key|auth[_-]?token|credential|password|private[_-]?key|secret|token)\s*[:=]\s*([\"']?)([^\"'\s,;]{8,})([\"']?)" |
There was a problem hiding this comment.
Redact suffixed credential names
redact_sensitive_text is now used for HTTP error bodies and Telegram runtime-error messages, but this pattern only matches exact keys such as token= or password= after a word boundary. Assignment forms using this app's actual credential names, e.g. TELEGRAM_TOKEN=... or FIRSTRADE_PASSWORD=..., do not match because the sensitive word is preceded by an underscore, so an exception containing those env-style assignments would still expose the raw secret despite the new redaction path.
Useful? React with 👍 / 👎.
Summary
Automated audit fixes for
FirstradePlatformfocused on runtime reliability, notification contract drift, secret-safe error handling, dependency pin consistency, and CI/Docker gates.Problems found
falsewhen unset, includingRUNTIME_TARGET_ENABLED, causing disabled-by-default behavior drift./healthand/healthzendpoints.Fixes applied
runtime_target_enableddefaulting to true.QPK_PINand fixed the QPK pin checker to only matchQuantPlatformKit.git@<sha>refs.pip check,pytest, and made QPK pin consistency a blocking check.--no-deps.ignoreconfig to[tool.ruff.lint]to remove the deprecation warning.Security impact
pip-auditfound no known vulnerabilities in the installed local environment.Architecture impact
Tests run
actionlint.venv/bin/ruff check --exclude external ..venv/bin/python -m pytest -q→163 passed.venv/bin/python scripts/check_qpk_pin_consistency.pyuv pip check --python .venv/bin/pythonuvx pip-audit --path .venvuv builddocker build -t firstradeplatform-audit:local .docker run --rm firstradeplatform-audit:local python - <<'PY' ... import main ... PYgit diff --checkFailed or skipped checks with reasons
uv buildsucceeds but emits a setuptools deprecation warning forproject.licensetable syntax; left as follow-up to avoid expanding build-system requirements in this PR.uv pip install -r requirements.txt -c constraints.txtinitially exposed a cross-repo git metadata conflict after QPK pin advancement; CI/Docker already use and now consistently enforce the no-deps git install path.Deployment notes
gate,test) pass.main, existing repository workflows may build/deploy according to their configured environment flags and approvals; do not bypass approval gates.Rollback plan
main.main.Manual follow-up checklist
pyproject.tomllicense metadata and raise build-system setuptools minimum before 2027-02-18.UsEquityStrategiesmetadata to the canonical QPK pin to reduce reliance on--no-depsgit installs.gateandtestafter this CI change.